package com.data.practice.array;

/**
 * Create with Intellij IDEA.
 * Description：
 * User:Zero
 * Date:2021/4/17
 * Time:8:30
 */
public class ExtendArray {
    public static void main(String[] args) {
        int[] ints = new int[10];
        for (int i = 0; i < ints.length; i++) {
              ints[i]=i;
        }
        //扩容
        int[] arr = new int[ints.length * 2];
        for (int i = 0; i < ints.length; i++) {
              arr[i]=ints[i];
        }
        ints=arr;
        System.out.println(ints.length);
        System.out.println(ints);
        System.out.println(ints.toString());
        for (int data: ints){
            System.out.println(data);
        }

        //System.out.println(arr);
    }
}
